﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace YouOweMe.Controls
{
    public partial class Menu : System.Web.UI.UserControl
    {
        protected void MenuRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item != null && e.Item.DataItem != null)
            {
                SiteMapNode node = e.Item.DataItem as SiteMapNode;
                if (node != null)
                {
                    if (string.Compare(node.Url, Request.Path, true) == 0)
                    {
                        HyperLink menuLink = e.Item.FindControl("menuLink") as HyperLink;
                        if (menuLink != null)
                        {
                            menuLink.CssClass = "current";
                        }
                    }
                }
            }
         
        }
    }
}